﻿@using Omu.AwesomeMvc
@using MvcApplication4.Controllers
@model MvcApplication4.Models.tb_Vacinacao

@{
    ViewBag.Title = "Cadastrar Vacina";
}

<h2>Cadastrar Vacina</h2>

@using (Html.BeginForm(FormMethod.Post))
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Cadastro Vacinação</legend>

       @* <div class="editor-label">
            @Html.LabelFor(model => model.ID_Vacinacao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ID_Vacinacao)
            @Html.ValidationMessageFor(model => model.ID_Vacinacao)
        </div>*@

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Paciente, "Paciente / Responsável")
        </div>
        <div class="editor-field">
            @*  @Html.DropDownList("ID_Paciente", String.Empty)*@
            @(Html.Awe().Autocomplete("Nome").PropId(o => o.ID_Paciente).Controller<NomeAutocompleteController>())
            @Html.HiddenFor(o => o.ID_Paciente) 
            @Html.ValidationMessageFor(model => model.ID_Paciente, "Selecione um paciente")
        </div>
        
@*        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Paciente, "Dependente (Se houver)")
        </div>
        
        <div class="editor-field">
            @Html.DropDownList("ID_Dependente", String.Empty)
            @(Html.Awe().AjaxDropdownFor(o => o.ID_Dependente).Controller<DependenteAjaxdropdownController>())
            @Html.HiddenFor(o => o.ID_Dependente) 
            @Html.ValidationMessageFor(model => model.ID_Dependente, "Selecione um dependente")
        </div>*@

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Funcionario, "Funcionário")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ID_Funcionario")
            @Html.ValidationMessageFor(model => model.ID_Funcionario, "Selecione um funcionário")
        </div>
     
        <div class="editor-label">
            @Html.LabelFor(model => model.ID_UBS, "UBS")
        </div>
        <div class="editor-field">
            @* @Html.DropDownList("ID_UBS", String.Empty)*@
            @(Html.Awe().AjaxDropdownFor(o => o.ID_UBS).Parent("ID_Funcionario").Controller<UBSAjaxDropdownController>())
            @Html.ValidationMessageFor(model => model.ID_UBS, "Selecione uma UBS")
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Vacina, "Vacina")
        </div>
        <div class="editor-field">
            @* @Html.DropDownList("ID_Vacina", String.Empty)*@
            @(Html.Awe().AjaxDropdownFor(o => o.ID_Vacina).Controller<Vacina1AjaxDropdownController>())
            @Html.ValidationMessageFor(model => model.ID_Vacina, "Selecione uma vacina")
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Lote, "LOTE")
        </div>
        <div class="editor-field">
            @*@Html.DropDownList("ID_Lote", String.Empty)*@
            @(Html.Awe().AjaxDropdownFor(o => o.ID_Lote).Parent(o => o.ID_Vacina).Controller<LoteAjaxDropdownController>())
            @Html.ValidationMessageFor(model => model.ID_Lote, "Selecione um Lote")
        </div>

@*        <div class="editor-label">
            @Html.LabelFor(model => model.Hora)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Hora)
            @Html.TextBox("Hora", DateTime.Now.TimeOfDay, new { @readonly = "readonly"})
            @Html.ValidationMessageFor(model => model.Hora, "Digite a hora")
        </div>*@

        <div class="editor-label">
            @Html.LabelFor(model => model.Data_Vacinacao, "Data Vacinação")
        </div>
        <div class="editor-field">
            @*@{ @Html.Syncfusion().DatePickerFor(model => model.Data_Vacinacao, (DatePickerModel)ViewData["datemodel"]) }*@
            @Html.TextBox("Data", DateTime.Now, new { @readonly = "readonly" })
            @Html.ValidationMessageFor(model => model.Data_Vacinacao, "Digite a data de vacinação")
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Motivo)
        </div>
        <div class="editor-field">
            @*@Html.EditorFor(model => model.Motivo)*@
            @*@Html.DropDownList("MotivoList")*@
            @(Html.Awe().AjaxDropdownFor(o => o.Motivo).Controller<MotivoAjaxDropdownController>())
            @Html.ValidationMessageFor(model => model.Motivo, "Selecione um motivo")
        </div>

        <p>
            <input type="submit" value="Cadastrar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Voltar", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

        